<template>
     <view :class="type==0?'article-list':'article-list2'">
         <view :class="type==0?'main-pd':''">
             <view class="u-card">
                 <view class="item" v-for="item in articleList" :key="item[keyName]" @click="checkInfo(item[keyName],url)">
                     <view class="font-32 color-000 u-line-1">{{ item.title }}</view>
                     <view class="font-28 color-8c8c8c u-m-t-16">{{ $u.timeFormat(item.createTime,'yyyy-mm-dd') }}</view>
                 </view>
             </view>
         </view>
     </view>
</template>
<script setup>
defineProps({
    articleList: {
        type: Array,
        default:()=>[]
    },
    url:{
        type:String,
        default:''
    },
    // 0单页 1页内
    type:{
        type:Number,
        default:0
    },
    // 主键名称
    keyName:{
        type:String,
        default:"id"
    },

})
const checkInfo = (id,url)=>{
    uni.$u.route(url+'?id='+id)
}
</script>
<style lang="scss" scoped>
.article-list {
    padding-top: 28rpx;
    padding-bottom: 80rpx;
}
.item{
    border-bottom: 1rpx solid #e6e6e6;
    padding-bottom: 28rpx;
    padding-top: 28rpx;
    &:first-child{
        padding-top: 0;
    }
    &:last-child{
        border:none;
        padding-bottom: 0;
    }
}
</style>